#define _CRT_SECURE_NO_WARNINGS

#include <iostream>
#include <list>
#include <string>
#include <vector>
using namespace std;

void test1()
{
	list<int> l1;
	l1.push_back(1);
	l1.push_back(2);
	l1.push_back(3);
	l1.push_back(4);
	l1.push_back(5);
	l1.push_back(6);
	for (auto e : l1)
	{
		cout << e << ' ';
	}
	cout << endl;

	list<string> l2;
	l2.push_back("abcdef");
	l2.push_back("xxxxxx");
	l2.push_back("wwwwww");
	l2.push_back("eeeeee");
	l2.push_back("llllll");
	l2.push_back("pppppp");
	for (auto e : l2)
	{
		cout << e << ' ';
	}
	cout << endl;

	list<vector<int>> l3;
	l3.push_back({ 1,1,1,1,1 });
	l3.push_back({ 0,0,0,0,0 });
	l3.push_back({ 5,5,5,5,5 });
	l3.push_back({ 4,4,4,4,4 });
	l3.push_back({ 9,9,9,9,9 });
	l3.push_back({ 2,2,2,2,2 });
	for (list<vector<int>>::iterator i = l3.begin(); i != l3.end(); ++i)
	{
		for (size_t j = 0; j < (*i).size(); ++j)
		{
			cout << (*i)[j] << ' ';
		}
		cout << endl;
	}
}

void test2()
{
	list<int> l1;
	l1.push_back(10);
	l1.push_back(3);
	l1.push_back(1);
	l1.push_back(6);
	l1.push_back(5);
	l1.push_back(7);
	l1.push_back(1);
	l1.push_back(9);
	l1.push_back(6);
	l1.push_back(4);
	l1.push_back(8);
	l1.push_back(6);
	list<int>::iterator it = l1.begin();
	while (it != l1.end())
	{
		cout << *it << ' ';
		++it;
	}
	cout << endl;
	l1.sort();
	for (list<int>::iterator i = l1.begin(); i != l1.end(); ++i)
	{
		cout << *i << ' ';
	}
	cout << endl;
}

int main()
{
	//test1();
	test2();

	return 0;
}